#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n, m;         // n种牌
ll c[55];         // 每种牌c[i]张
bool check(int x) // 组成x套牌，每套n种不同的牌
{
    ll t = 0;
    for (int i = 1; i <= n; i++)
        if (c[i] < x)
            t += x - c[i]; // 如果第i种牌不够x张了，就需要用joker补，但是joker牌的总数也不能超过x张
    return t <= x && t <= m;
}
int main()
{
#ifdef LZH_LOCAL
    freopen("in.in", "r", stdin);
    // freopen("out.out", "w", stdout);
#endif
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin >> n >> m;
    for (int i = 1; i <= n; i++)
        cin >> c[i];
    ll l = 0, r = 1e9;
    while (l <= r)
    {
        ll mid = (l + r) >> 1;
        if (check(mid))
            l = mid + 1;
        else
            r = mid - 1;
    }
    cout << r << endl;
    return 0;
}
